package com.cms.recursoshumanos.facade;

import com.cms.recursoshumanos.constant.Constant;
import com.cms.recursoshumanos.handler.WServiceCall;
import com.cms.recursoshumanos.json.me.JSONParser;
import com.cms.recursoshumanos.json.object.JsonObjectGetContactos;

public class ListaContactoScreenFacade 
{
	private String strUsername;
	private String strPass;
	private String strFecha;
	private int intPosition;
	
	public ListaContactoScreenFacade(String user,
										String password,
										String fecha_selec)
	{
		this.strUsername = user;
		this.strPass = password;
		this.strFecha = fecha_selec;
		
	}
	public void getListaContacto()
	{
		enviarSolicitud();
	}
	
	public String enviarSolicitud() 
	{
		JSONParser jParser = new JSONParser();
		return setValores(jParser.
						getJSONFromUrl(
								Constant.URL_WEBSERVICE, 
								WServiceCall.getInstance().getListaContacto(strUsername,strPass,strFecha)));
        
	}
	
	public String setValores(String strResult)
	{
		JsonObjectGetContactos.getInstance().fromJSON(intPosition,strResult);
		return 	JsonObjectGetContactos.getInstance().getResult();
		
	}
	

	
}
